home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_HDF.idb / usr / freeware / include / hdf / bitvect.h.z / bitvect.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  23.3 KB  |  386 lines

  1. /****************************************************************************
  2.  * NCSA HDF                                                                 *
  3.  * Software Development Group                                               *
  4.  * National Center for Supercomputing Applications                          *
  5.  * University of Illinois at Urbana-Champaign                               *
  6.  * 605 E. Springfield, Champaign IL 61820                                   *
  7.  *                                                                          *
  8.  * For conditions of distribution and use, see the accompanying             *
  9.  * hdf/COPYING file.                                                        *
  10.  *                                                                          *
  11.  ****************************************************************************/
  12.  
  13. /* $Id: bitvect.h,v 1.2 1996/03/28 21:57:06 koziol Exp $ */
  14.  
  15. /*-----------------------------------------------------------------------------
  16.  * File:    bitvect.h
  17.  * Purpose: header file for bit-vector API
  18.  * Dependencies: 
  19.  * Invokes:
  20.  * Contents:
  21.  * Structure definitions: 
  22.  * Constant definitions: 
  23.  *---------------------------------------------------------------------------*/
  24.  
  25. /* avoid re-inclusion */
  26. #ifndef __BITVECT_H
  27. #define __BITVECT_H
  28.  
  29. #include "hdf.h"
  30.  
  31. /* Boolean values used */
  32. typedef enum {BV_FALSE=0, BV_TRUE=1} bv_bool;
  33.  
  34. /* Flags for the bit-vector */
  35. #define BV_INIT_TO_ONE  0x00000001  /* to indicate whether to create the bit-vector with one's instead of zero's */
  36. #define BV_EXTENDABLE   0x00000002  /* to indicate that the bit-vector can be extended */
  37.  
  38. /* Default size of a bit-vector */
  39. #define BV_DEFAULT_BITS 128
  40.  
  41. /* Define the size of the chunks bits are allocated in */
  42. #define BV_CHUNK_SIZE 64
  43.  
  44. /* Create the external interface data structures needed */
  45. typedef struct bv_struct_tag *bv_ptr;
  46.  
  47. #if defined BV_MASTER | defined BV_TESTER
  48.  
  49. /* Base type of the array used to store the bits */
  50. typedef unsigned char bv_base;
  51.  
  52. /* # of bits in the base type of the array used to store the bits */
  53. #define BV_BASE_BITS    (sizeof(bv_base)*8)
  54.  
  55. /* bit-vector structure used */
  56. typedef struct bv_struct_tag {
  57.     uint32 bits_used;       /* The actual number of bits current in use */
  58.     uint32 array_size;      /* The number of bv_base elements in the bit-vector */
  59.     uint32 flags;           /* The flags used to create this bit-vector */
  60.     int32 last_zero;        /* The last location we know had a zero bit */
  61.     bv_base *buffer;        /* Pointer to the buffer used to store the bits */
  62.   }bv_struct;
  63.  
  64. /* Table of bits for each bit position */
  65. /*  (This will need to be changed/expanded if another base type is used) */
  66. static const uint8 bv_bit_value[8]={
  67.     1,  /* bit 0's value is 1 */
  68.     2,  /* bit 1's value is 2 */
  69.     4,  /* bit 2's value is 4 */
  70.     8,  /* bit 3's value is 8 */
  71.     16,  /* bit 4's value is 16 */
  72.     32,  /* bit 5's value is 32 */
  73.     64,  /* bit 6's value is 64 */
  74.     128   /* bit 7's value is 128 */
  75. };
  76.  
  77. /* Table of bit-masks for each number of bits in a byte */
  78. /*  (This will need to be changed/expanded if another base type is used) */
  79. static const uint8 bv_bit_mask[9]={
  80.     0x00,  /* 0 bits is a mask of 0x00 */
  81.     0x01,  /* 1 bits is a mask of 0x01 */
  82.     0x03,  /* 2 bits is a mask of 0x03 */
  83.     0x07,  /* 3 bits is a mask of 0x07 */
  84.     0x0F,  /* 4 bits is a mask of 0x0F */
  85.     0x1F,  /* 5 bits is a mask of 0x1F */
  86.     0x3F,  /* 6 bits is a mask of 0x3F */
  87.     0x7F,  /* 7 bits is a mask of 0x7F */
  88.     0xFF   /* 8 bits is a mask of 0xFF */
  89. };
  90.  
  91. /* Table of "first zero bit" for each byte value */
  92. /*  (This will need to be changed/expanded if another base type is used) */
  93. static const int8 bv_first_zero[256]={
  94.     0,  /* "0" - bit 0 is lowest zero */ 1,  /* "1" - bit 1 is lowest zero */
  95.     0,  /* "2" - bit 0 is lowest zero */ 2,  /* "3" - bit 2 is lowest zero */
  96.     0,  /* "4" - bit 0 is lowest zero */ 1,  /* "5" - bit 1 is lowest zero */
  97.     0,  /* "6" - bit 0 is lowest zero */ 3,  /* "7" - bit 3 is lowest zero */
  98.     0,  /* "8" - bit 0 is lowest zero */ 1,  /* "9" - bit 1 is lowest zero */
  99.     0,  /* "10" - bit 0 is lowest zero */ 2,  /* "11" - bit 2 is lowest zero */
  100.     0,  /* "12" - bit 0 is lowest zero */ 1,  /* "13" - bit 1 is lowest zero */
  101.     0,  /* "14" - bit 0 is lowest zero */ 4,  /* "15" - bit 4 is lowest zero */
  102.     0,  /* "16" - bit 0 is lowest zero */ 1,  /* "17" - bit 1 is lowest zero */
  103.     0,  /* "18" - bit 0 is lowest zero */ 2,  /* "19" - bit 2 is lowest zero */
  104.     0,  /* "20" - bit 0 is lowest zero */ 1,  /* "21" - bit 1 is lowest zero */
  105.     0,  /* "22" - bit 0 is lowest zero */ 3,  /* "23" - bit 3 is lowest zero */
  106.     0,  /* "24" - bit 0 is lowest zero */ 1,  /* "25" - bit 1 is lowest zero */
  107.     0,  /* "26" - bit 0 is lowest zero */ 2,  /* "27" - bit 2 is lowest zero */
  108.     0,  /* "28" - bit 0 is lowest zero */ 1,  /* "29" - bit 1 is lowest zero */
  109.     0,  /* "30" - bit 0 is lowest zero */ 5,  /* "31" - bit 5 is lowest zero */
  110.     0,  /* "32" - bit 0 is lowest zero */ 1,  /* "33" - bit 1 is lowest zero */
  111.     0,  /* "34" - bit 0 is lowest zero */ 2,  /* "35" - bit 2 is lowest zero */
  112.     0,  /* "36" - bit 0 is lowest zero */ 1,  /* "37" - bit 1 is lowest zero */
  113.     0,  /* "38" - bit 0 is lowest zero */ 3,  /* "39" - bit 3 is lowest zero */
  114.     0,  /* "40" - bit 0 is lowest zero */ 1,  /* "41" - bit 1 is lowest zero */
  115.     0,  /* "42" - bit 0 is lowest zero */ 2,  /* "43" - bit 2 is lowest zero */
  116.     0,  /* "44" - bit 0 is lowest zero */ 1,  /* "45" - bit 1 is lowest zero */
  117.     0,  /* "46" - bit 0 is lowest zero */ 4,  /* "47" - bit 4 is lowest zero */
  118.     0,  /* "48" - bit 0 is lowest zero */ 1,  /* "49" - bit 1 is lowest zero */
  119.     0,  /* "50" - bit 0 is lowest zero */ 2,  /* "51" - bit 2 is lowest zero */
  120.     0,  /* "52" - bit 0 is lowest zero */ 1,  /* "53" - bit 1 is lowest zero */
  121.     0,  /* "54" - bit 0 is lowest zero */ 3,  /* "55" - bit 3 is lowest zero */
  122.     0,  /* "56" - bit 0 is lowest zero */ 1,  /* "57" - bit 1 is lowest zero */
  123.     0,  /* "58" - bit 0 is lowest zero */ 2,  /* "59" - bit 2 is lowest zero */
  124.     0,  /* "60" - bit 0 is lowest zero */ 1,  /* "61" - bit 1 is lowest zero */
  125.     0,  /* "62" - bit 0 is lowest zero */ 6,  /* "63" - bit 6 is lowest zero */
  126.     0,  /* "64" - bit 0 is lowest zero */ 1,  /* "65" - bit 1 is lowest zero */
  127.     0,  /* "66" - bit 0 is lowest zero */ 2,  /* "67" - bit 2 is lowest zero */
  128.     0,  /* "68" - bit 0 is lowest zero */ 1,  /* "69" - bit 1 is lowest zero */
  129.     0,  /* "70" - bit 0 is lowest zero */ 3,  /* "71" - bit 3 is lowest zero */
  130.     0,  /* "72" - bit 0 is lowest zero */ 1,  /* "73" - bit 1 is lowest zero */
  131.     0,  /* "74" - bit 0 is lowest zero */ 2,  /* "75" - bit 2 is lowest zero */
  132.     0,  /* "76" - bit 0 is lowest zero */ 1,  /* "77" - bit 1 is lowest zero */
  133.     0,  /* "78" - bit 0 is lowest zero */ 4,  /* "79" - bit 4 is lowest zero */
  134.     0,  /* "80" - bit 0 is lowest zero */ 1,  /* "81" - bit 1 is lowest zero */
  135.     0,  /* "82" - bit 0 is lowest zero */ 2,  /* "83" - bit 2 is lowest zero */
  136.     0,  /* "84" - bit 0 is lowest zero */ 1,  /* "85" - bit 1 is lowest zero */
  137.     0,  /* "86" - bit 0 is lowest zero */ 3,  /* "87" - bit 3 is lowest zero */
  138.     0,  /* "88" - bit 0 is lowest zero */ 1,  /* "89" - bit 1 is lowest zero */
  139.     0,  /* "90" - bit 0 is lowest zero */ 2,  /* "91" - bit 2 is lowest zero */
  140.     0,  /* "92" - bit 0 is lowest zero */ 1,  /* "93" - bit 1 is lowest zero */
  141.     0,  /* "94" - bit 0 is lowest zero */ 5,  /* "95" - bit 5 is lowest zero */
  142.     0,  /* "96" - bit 0 is lowest zero */ 1,  /* "97" - bit 1 is lowest zero */
  143.     0,  /* "98" - bit 0 is lowest zero */ 2,  /* "99" - bit 2 is lowest zero */
  144.     0,  /* "100" - bit 0 is lowest zero */ 1,  /* "101" - bit 1 is lowest zero */
  145.     0,  /* "102" - bit 0 is lowest zero */ 3,  /* "103" - bit 3 is lowest zero */
  146.     0,  /* "104" - bit 0 is lowest zero */ 1,  /* "105" - bit 1 is lowest zero */
  147.     0,  /* "106" - bit 0 is lowest zero */ 2,  /* "107" - bit 2 is lowest zero */
  148.     0,  /* "108" - bit 0 is lowest zero */ 1,  /* "109" - bit 1 is lowest zero */
  149.     0,  /* "110" - bit 0 is lowest zero */ 4,  /* "111" - bit 4 is lowest zero */
  150.     0,  /* "112" - bit 0 is lowest zero */ 1,  /* "113" - bit 1 is lowest zero */
  151.     0,  /* "114" - bit 0 is lowest zero */ 2,  /* "115" - bit 2 is lowest zero */
  152.     0,  /* "116" - bit 0 is lowest zero */ 1,  /* "117" - bit 1 is lowest zero */
  153.     0,  /* "118" - bit 0 is lowest zero */ 3,  /* "119" - bit 3 is lowest zero */
  154.     0,  /* "120" - bit 0 is lowest zero */ 1,  /* "121" - bit 1 is lowest zero */
  155.     0,  /* "122" - bit 0 is lowest zero */ 2,  /* "123" - bit 2 is lowest zero */
  156.     0,  /* "124" - bit 0 is lowest zero */ 1,  /* "125" - bit 1 is lowest zero */
  157.     0,  /* "126" - bit 0 is lowest zero */ 7,  /* "127" - bit 7 is lowest zero */
  158.     0,  /* "128" - bit 0 is lowest zero */ 1,  /* "129" - bit 1 is lowest zero */
  159.     0,  /* "130" - bit 0 is lowest zero */ 2,  /* "131" - bit 2 is lowest zero */
  160.     0,  /* "132" - bit 0 is lowest zero */ 1,  /* "133" - bit 1 is lowest zero */
  161.     0,  /* "134" - bit 0 is lowest zero */ 3,  /* "135" - bit 3 is lowest zero */
  162.     0,  /* "136" - bit 0 is lowest zero */ 1,  /* "137" - bit 1 is lowest zero */
  163.     0,  /* "138" - bit 0 is lowest zero */ 2,  /* "139" - bit 2 is lowest zero */
  164.     0,  /* "140" - bit 0 is lowest zero */ 1,  /* "141" - bit 1 is lowest zero */
  165.     0,  /* "142" - bit 0 is lowest zero */ 4,  /* "143" - bit 4 is lowest zero */
  166.     0,  /* "144" - bit 0 is lowest zero */ 1,  /* "145" - bit 1 is lowest zero */
  167.     0,  /* "146" - bit 0 is lowest zero */ 2,  /* "147" - bit 2 is lowest zero */
  168.     0,  /* "148" - bit 0 is lowest zero */ 1,  /* "149" - bit 1 is lowest zero */
  169.     0,  /* "150" - bit 0 is lowest zero */ 3,  /* "151" - bit 3 is lowest zero */
  170.     0,  /* "152" - bit 0 is lowest zero */ 1,  /* "153" - bit 1 is lowest zero */
  171.     0,  /* "154" - bit 0 is lowest zero */ 2,  /* "155" - bit 2 is lowest zero */
  172.     0,  /* "156" - bit 0 is lowest zero */ 1,  /* "157" - bit 1 is lowest zero */
  173.     0,  /* "158" - bit 0 is lowest zero */ 5,  /* "159" - bit 5 is lowest zero */
  174.     0,  /* "160" - bit 0 is lowest zero */ 1,  /* "161" - bit 1 is lowest zero */
  175.     0,  /* "162" - bit 0 is lowest zero */ 2,  /* "163" - bit 2 is lowest zero */
  176.     0,  /* "164" - bit 0 is lowest zero */ 1,  /* "165" - bit 1 is lowest zero */
  177.     0,  /* "166" - bit 0 is lowest zero */ 3,  /* "167" - bit 3 is lowest zero */
  178.     0,  /* "168" - bit 0 is lowest zero */ 1,  /* "169" - bit 1 is lowest zero */
  179.     0,  /* "170" - bit 0 is lowest zero */ 2,  /* "171" - bit 2 is lowest zero */
  180.     0,  /* "172" - bit 0 is lowest zero */ 1,  /* "173" - bit 1 is lowest zero */
  181.     0,  /* "174" - bit 0 is lowest zero */ 4,  /* "175" - bit 4 is lowest zero */
  182.     0,  /* "176" - bit 0 is lowest zero */ 1,  /* "177" - bit 1 is lowest zero */
  183.     0,  /* "178" - bit 0 is lowest zero */ 2,  /* "179" - bit 2 is lowest zero */
  184.     0,  /* "180" - bit 0 is lowest zero */ 1,  /* "181" - bit 1 is lowest zero */
  185.     0,  /* "182" - bit 0 is lowest zero */ 3,  /* "183" - bit 3 is lowest zero */
  186.     0,  /* "184" - bit 0 is lowest zero */ 1,  /* "185" - bit 1 is lowest zero */
  187.     0,  /* "186" - bit 0 is lowest zero */ 2,  /* "187" - bit 2 is lowest zero */
  188.     0,  /* "188" - bit 0 is lowest zero */ 1,  /* "189" - bit 1 is lowest zero */
  189.     0,  /* "190" - bit 0 is lowest zero */ 6,  /* "191" - bit 6 is lowest zero */
  190.     0,  /* "192" - bit 0 is lowest zero */ 1,  /* "193" - bit 1 is lowest zero */
  191.     0,  /* "194" - bit 0 is lowest zero */ 2,  /* "195" - bit 2 is lowest zero */
  192.     0,  /* "196" - bit 0 is lowest zero */ 1,  /* "197" - bit 1 is lowest zero */
  193.     0,  /* "198" - bit 0 is lowest zero */ 3,  /* "199" - bit 3 is lowest zero */
  194.     0,  /* "200" - bit 0 is lowest zero */ 1,  /* "201" - bit 1 is lowest zero */
  195.     0,  /* "202" - bit 0 is lowest zero */ 2,  /* "203" - bit 2 is lowest zero */
  196.     0,  /* "204" - bit 0 is lowest zero */ 1,  /* "205" - bit 1 is lowest zero */
  197.     0,  /* "206" - bit 0 is lowest zero */ 4,  /* "207" - bit 4 is lowest zero */
  198.     0,  /* "208" - bit 0 is lowest zero */ 1,  /* "209" - bit 1 is lowest zero */
  199.     0,  /* "210" - bit 0 is lowest zero */ 2,  /* "211" - bit 2 is lowest zero */
  200.     0,  /* "212" - bit 0 is lowest zero */ 1,  /* "213" - bit 1 is lowest zero */
  201.     0,  /* "214" - bit 0 is lowest zero */ 3,  /* "215" - bit 3 is lowest zero */
  202.     0,  /* "216" - bit 0 is lowest zero */ 1,  /* "217" - bit 1 is lowest zero */
  203.     0,  /* "218" - bit 0 is lowest zero */ 2,  /* "219" - bit 2 is lowest zero */
  204.     0,  /* "220" - bit 0 is lowest zero */ 1,  /* "221" - bit 1 is lowest zero */
  205.     0,  /* "222" - bit 0 is lowest zero */ 5,  /* "223" - bit 5 is lowest zero */
  206.     0,  /* "224" - bit 0 is lowest zero */ 1,  /* "225" - bit 1 is lowest zero */
  207.     0,  /* "226" - bit 0 is lowest zero */ 2,  /* "227" - bit 2 is lowest zero */
  208.     0,  /* "228" - bit 0 is lowest zero */ 1,  /* "229" - bit 1 is lowest zero */
  209.     0,  /* "230" - bit 0 is lowest zero */ 3,  /* "231" - bit 3 is lowest zero */
  210.     0,  /* "232" - bit 0 is lowest zero */ 1,  /* "233" - bit 1 is lowest zero */
  211.     0,  /* "234" - bit 0 is lowest zero */ 2,  /* "235" - bit 2 is lowest zero */
  212.     0,  /* "236" - bit 0 is lowest zero */ 1,  /* "237" - bit 1 is lowest zero */
  213.     0,  /* "238" - bit 0 is lowest zero */ 4,  /* "239" - bit 4 is lowest zero */
  214.     0,  /* "240" - bit 0 is lowest zero */ 1,  /* "241" - bit 1 is lowest zero */
  215.     0,  /* "242" - bit 0 is lowest zero */ 2,  /* "243" - bit 2 is lowest zero */
  216.     0,  /* "244" - bit 0 is lowest zero */ 1,  /* "245" - bit 1 is lowest zero */
  217.     0,  /* "246" - bit 0 is lowest zero */ 3,  /* "247" - bit 3 is lowest zero */
  218.     0,  /* "248" - bit 0 is lowest zero */ 1,  /* "249" - bit 1 is lowest zero */
  219.     0,  /* "250" - bit 0 is lowest zero */ 2,  /* "251" - bit 2 is lowest zero */
  220.     0,  /* "252" - bit 0 is lowest zero */ 1,  /* "253" - bit 1 is lowest zero */
  221.     0,  /* "254" - bit 0 is lowest zero */ 8   /* "255" - bit 8 is lowest zero */
  222. };
  223.  
  224. /* Table of "number of 1 bits" for each byte value */
  225. /*  (This will need to be changed/expanded if another base type is used) */
  226. static const int8 bv_num_ones[256]={
  227.     0,  /* "0" - n bits are 1's */ 1,  /* "1" - n bits are 1's */
  228.     1,  /* "2" - n bits are 1's */ 2,  /* "3" - n bits are 1's */
  229.     1,  /* "4" - n bits are 1's */ 2,  /* "5" - n bits are 1's */
  230.     2,  /* "6" - n bits are 1's */ 3,  /* "7" - n bits are 1's */
  231.     1,  /* "8" - n bits are 1's */ 2,  /* "9" - n bits are 1's */
  232.     2,  /* "10" - n bits are 1's */ 3,  /* "11" - n bits are 1's */
  233.     2,  /* "12" - n bits are 1's */ 3,  /* "13" - n bits are 1's */
  234.     3,  /* "14" - n bits are 1's */ 4,  /* "15" - n bits are 1's */
  235.     1,  /* "16" - n bits are 1's */ 2,  /* "17" - n bits are 1's */
  236.     2,  /* "18" - n bits are 1's */ 3,  /* "19" - n bits are 1's */
  237.     2,  /* "20" - n bits are 1's */ 3,  /* "21" - n bits are 1's */
  238.     3,  /* "22" - n bits are 1's */ 4,  /* "23" - n bits are 1's */
  239.     2,  /* "24" - n bits are 1's */ 3,  /* "25" - n bits are 1's */
  240.     3,  /* "26" - n bits are 1's */ 4,  /* "27" - n bits are 1's */
  241.     3,  /* "28" - n bits are 1's */ 3,  /* "29" - n bits are 1's */
  242.     4,  /* "30" - n bits are 1's */ 5,  /* "31" - n bits are 1's */
  243.     1,  /* "32" - n bits are 1's */ 2,  /* "33" - n bits are 1's */
  244.     2,  /* "34" - n bits are 1's */ 3,  /* "35" - n bits are 1's */
  245.     2,  /* "36" - n bits are 1's */ 3,  /* "37" - n bits are 1's */
  246.     3,  /* "38" - n bits are 1's */ 4,  /* "39" - n bits are 1's */
  247.     2,  /* "40" - n bits are 1's */ 3,  /* "41" - n bits are 1's */
  248.     3,  /* "42" - n bits are 1's */ 4,  /* "43" - n bits are 1's */
  249.     3,  /* "44" - n bits are 1's */ 4,  /* "45" - n bits are 1's */
  250.     4,  /* "46" - n bits are 1's */ 5,  /* "47" - n bits are 1's */
  251.     2,  /* "48" - n bits are 1's */ 3,  /* "49" - n bits are 1's */
  252.     3,  /* "50" - n bits are 1's */ 4,  /* "51" - n bits are 1's */
  253.     3,  /* "52" - n bits are 1's */ 4,  /* "53" - n bits are 1's */
  254.     4,  /* "54" - n bits are 1's */ 5,  /* "55" - n bits are 1's */
  255.     3,  /* "56" - n bits are 1's */ 4,  /* "57" - n bits are 1's */
  256.     4,  /* "58" - n bits are 1's */ 5,  /* "59" - n bits are 1's */
  257.     4,  /* "60" - n bits are 1's */ 5,  /* "61" - n bits are 1's */
  258.     5,  /* "62" - n bits are 1's */ 6,  /* "63" - n bits are 1's */
  259.     1,  /* "64" - n bits are 1's */ 2,  /* "65" - n bits are 1's */
  260.     2,  /* "66" - n bits are 1's */ 3,  /* "67" - n bits are 1's */
  261.     2,  /* "68" - n bits are 1's */ 3,  /* "69" - n bits are 1's */
  262.     3,  /* "70" - n bits are 1's */ 4,  /* "71" - n bits are 1's */
  263.     2,  /* "72" - n bits are 1's */ 3,  /* "73" - n bits are 1's */
  264.     3,  /* "74" - n bits are 1's */ 4,  /* "75" - n bits are 1's */
  265.     3,  /* "76" - n bits are 1's */ 4,  /* "77" - n bits are 1's */
  266.     4,  /* "78" - n bits are 1's */ 5,  /* "79" - n bits are 1's */
  267.     2,  /* "80" - n bits are 1's */ 3,  /* "81" - n bits are 1's */
  268.     3,  /* "82" - n bits are 1's */ 4,  /* "83" - n bits are 1's */
  269.     3,  /* "84" - n bits are 1's */ 4,  /* "85" - n bits are 1's */
  270.     4,  /* "86" - n bits are 1's */ 5,  /* "87" - n bits are 1's */
  271.     3,  /* "88" - n bits are 1's */ 4,  /* "89" - n bits are 1's */
  272.     4,  /* "90" - n bits are 1's */ 5,  /* "91" - n bits are 1's */
  273.     4,  /* "92" - n bits are 1's */ 5,  /* "93" - n bits are 1's */
  274.     5,  /* "94" - n bits are 1's */ 6,  /* "95" - n bits are 1's */
  275.     2,  /* "96" - n bits are 1's */ 3,  /* "97" - n bits are 1's */
  276.     3,  /* "98" - n bits are 1's */ 4,  /* "99" - n bits are 1's */
  277.     3,  /* "100" - n bits are 1's */ 4,  /* "101" - n bits are 1's */
  278.     4,  /* "102" - n bits are 1's */ 5,  /* "103" - n bits are 1's */
  279.     3,  /* "104" - n bits are 1's */ 4,  /* "105" - n bits are 1's */
  280.     4,  /* "106" - n bits are 1's */ 5,  /* "107" - n bits are 1's */
  281.     3,  /* "108" - n bits are 1's */ 4,  /* "109" - n bits are 1's */
  282.     4,  /* "110" - n bits are 1's */ 5,  /* "111" - n bits are 1's */
  283.     3,  /* "112" - n bits are 1's */ 4,  /* "113" - n bits are 1's */
  284.     4,  /* "114" - n bits are 1's */ 5,  /* "115" - n bits are 1's */
  285.     4,  /* "116" - n bits are 1's */ 5,  /* "117" - n bits are 1's */
  286.     5,  /* "118" - n bits are 1's */ 6,  /* "119" - n bits are 1's */
  287.     4,  /* "120" - n bits are 1's */ 5,  /* "121" - n bits are 1's */
  288.     5,  /* "122" - n bits are 1's */ 6,  /* "123" - n bits are 1's */
  289.     5,  /* "124" - n bits are 1's */ 6,  /* "125" - n bits are 1's */
  290.     6,  /* "126" - n bits are 1's */ 7,  /* "127" - n bits are 1's */
  291.     1,  /* "128" - n bits are 1's */ 2,  /* "129" - n bits are 1's */
  292.     2,  /* "130" - n bits are 1's */ 3,  /* "131" - n bits are 1's */
  293.     2,  /* "132" - n bits are 1's */ 3,  /* "133" - n bits are 1's */
  294.     3,  /* "134" - n bits are 1's */ 4,  /* "135" - n bits are 1's */
  295.     2,  /* "136" - n bits are 1's */ 3,  /* "137" - n bits are 1's */
  296.     3,  /* "138" - n bits are 1's */ 4,  /* "139" - n bits are 1's */
  297.     3,  /* "140" - n bits are 1's */ 4,  /* "141" - n bits are 1's */
  298.     4,  /* "142" - n bits are 1's */ 5,  /* "143" - n bits are 1's */
  299.     2,  /* "144" - n bits are 1's */ 3,  /* "145" - n bits are 1's */
  300.     3,  /* "146" - n bits are 1's */ 4,  /* "147" - n bits are 1's */
  301.     3,  /* "148" - n bits are 1's */ 4,  /* "149" - n bits are 1's */
  302.     4,  /* "150" - n bits are 1's */ 5,  /* "151" - n bits are 1's */
  303.     3,  /* "152" - n bits are 1's */ 4,  /* "153" - n bits are 1's */
  304.     4,  /* "154" - n bits are 1's */ 5,  /* "155" - n bits are 1's */
  305.     4,  /* "156" - n bits are 1's */ 5,  /* "157" - n bits are 1's */
  306.     5,  /* "158" - n bits are 1's */ 6,  /* "159" - n bits are 1's */
  307.     2,  /* "160" - n bits are 1's */ 3,  /* "161" - n bits are 1's */
  308.     3,  /* "162" - n bits are 1's */ 4,  /* "163" - n bits are 1's */
  309.     3,  /* "164" - n bits are 1's */ 4,  /* "165" - n bits are 1's */
  310.     4,  /* "166" - n bits are 1's */ 5,  /* "167" - n bits are 1's */
  311.     3,  /* "168" - n bits are 1's */ 4,  /* "169" - n bits are 1's */
  312.     4,  /* "170" - n bits are 1's */ 5,  /* "171" - n bits are 1's */
  313.     4,  /* "172" - n bits are 1's */ 5,  /* "173" - n bits are 1's */
  314.     5,  /* "174" - n bits are 1's */ 6,  /* "175" - n bits are 1's */
  315.     3,  /* "176" - n bits are 1's */ 4,  /* "177" - n bits are 1's */
  316.     4,  /* "178" - n bits are 1's */ 5,  /* "179" - n bits are 1's */
  317.     4,  /* "180" - n bits are 1's */ 5,  /* "181" - n bits are 1's */
  318.     5,  /* "182" - n bits are 1's */ 6,  /* "183" - n bits are 1's */
  319.     4,  /* "184" - n bits are 1's */ 5,  /* "185" - n bits are 1's */
  320.     5,  /* "186" - n bits are 1's */ 6,  /* "187" - n bits are 1's */
  321.     5,  /* "188" - n bits are 1's */ 6,  /* "189" - n bits are 1's */
  322.     6,  /* "190" - n bits are 1's */ 7,  /* "191" - n bits are 1's */
  323.     2,  /* "192" - n bits are 1's */ 3,  /* "193" - n bits are 1's */
  324.     3,  /* "194" - n bits are 1's */ 4,  /* "195" - n bits are 1's */
  325.     3,  /* "196" - n bits are 1's */ 4,  /* "197" - n bits are 1's */
  326.     4,  /* "198" - n bits are 1's */ 5,  /* "199" - n bits are 1's */
  327.     3,  /* "200" - n bits are 1's */ 4,  /* "201" - n bits are 1's */
  328.     4,  /* "202" - n bits are 1's */ 5,  /* "203" - n bits are 1's */
  329.     4,  /* "204" - n bits are 1's */ 5,  /* "205" - n bits are 1's */
  330.     5,  /* "206" - n bits are 1's */ 6,  /* "207" - n bits are 1's */
  331.     3,  /* "208" - n bits are 1's */ 4,  /* "209" - n bits are 1's */
  332.     4,  /* "210" - n bits are 1's */ 5,  /* "211" - n bits are 1's */
  333.     4,  /* "212" - n bits are 1's */ 5,  /* "213" - n bits are 1's */
  334.     5,  /* "214" - n bits are 1's */ 6,  /* "215" - n bits are 1's */
  335.     4,  /* "216" - n bits are 1's */ 5,  /* "217" - n bits are 1's */
  336.     5,  /* "218" - n bits are 1's */ 6,  /* "219" - n bits are 1's */
  337.     5,  /* "220" - n bits are 1's */ 6,  /* "221" - n bits are 1's */
  338.     6,  /* "222" - n bits are 1's */ 7,  /* "223" - n bits are 1's */
  339.     3,  /* "224" - n bits are 1's */ 4,  /* "225" - n bits are 1's */
  340.     4,  /* "226" - n bits are 1's */ 5,  /* "227" - n bits are 1's */
  341.     4,  /* "228" - n bits are 1's */ 5,  /* "229" - n bits are 1's */
  342.     5,  /* "230" - n bits are 1's */ 6,  /* "231" - n bits are 1's */
  343.     4,  /* "232" - n bits are 1's */ 5,  /* "233" - n bits are 1's */
  344.     5,  /* "234" - n bits are 1's */ 6,  /* "235" - n bits are 1's */
  345.     5,  /* "236" - n bits are 1's */ 6,  /* "237" - n bits are 1's */
  346.     6,  /* "238" - n bits are 1's */ 7,  /* "239" - n bits are 1's */
  347.     4,  /* "240" - n bits are 1's */ 5,  /* "241" - n bits are 1's */
  348.     5,  /* "242" - n bits are 1's */ 6,  /* "243" - n bits are 1's */
  349.     5,  /* "244" - n bits are 1's */ 6,  /* "245" - n bits are 1's */
  350.     6,  /* "246" - n bits are 1's */ 7,  /* "247" - n bits are 1's */
  351.     5,  /* "248" - n bits are 1's */ 6,  /* "249" - n bits are 1's */
  352.     6,  /* "250" - n bits are 1's */ 7,  /* "251" - n bits are 1's */
  353.     6,  /* "252" - n bits are 1's */ 7,  /* "253" - n bits are 1's */
  354.     7,  /* "254" - n bits are 1's */ 8   /* "255" - n bits are 1's */
  355. };
  356.  
  357. /* Useful routines for generally private use */
  358.  
  359. #endif /* BV_MASTER | BV_TESTER */
  360. #if defined c_plusplus || defined __cplusplus
  361. extern      "C"
  362. {
  363. #endif                          /* c_plusplus || __cplusplus */
  364. extern bv_ptr bv_new(int32 num_bits, uint32 flags);
  365.  
  366. extern intn bv_delete(bv_ptr b);
  367.  
  368. extern intn bv_set(bv_ptr b, int32 bit_num, bv_bool value);
  369.  
  370. extern intn bv_get(bv_ptr b, int32 bit_num);
  371.  
  372. extern intn bv_clear(bv_ptr b, bv_bool value);
  373.  
  374. extern int32 bv_size(bv_ptr b);
  375.  
  376. extern uint32 bv_flags(bv_ptr b);
  377.  
  378. extern int32 bv_find(bv_ptr b, int32 last_find, bv_bool value);
  379.  
  380. #if defined c_plusplus || defined __cplusplus
  381. }
  382. #endif                          /* c_plusplus || __cplusplus */
  383.  
  384. #endif /* __BITVECT_H */
  385.  
  386.